/**
  ******************************************************************************
  * @file    set_io.c
  * @author  Hanif Rizal
  * @version V1.0.0
  * @date    03-Maret-2013
  * @brief   ATXmega I/O access routine
  *              
  *  @verbatim
  *  
  *          ===================================================================
  *                                 How to use this driver
  *          ===================================================================              
  *   
  *  @endverbatim
  *    
  ******************************************************************************
  * @attention
  *
  * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
  * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
  * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
  * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
  * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
  * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
  *
  * <h2><center>&copy; COPYRIGHT 2013 Vibration Monitoring System TEAM</center></h2>
  ******************************************************************************
  */
#include "set_io.h"

void myInitXMegaBoard(void)
{
	PORTR.DIRSET = (1<< 1) | (1<<0);	//PORTR 0 dan 1 output
	PORTR.PIN0CTRL = PORT_OPC_WIREDANDPULL_gc;
	PORTR.PIN1CTRL = PORT_OPC_WIREDANDPULL_gc;
	

/*	ioport_configure_pin(LED0_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
	ioport_configure_pin(LED1_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
	ioport_configure_pin(LED2_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_HIGH);
	ioport_configure_pin(LED3_GPIO, IOPORT_DIR_OUTPUT | IOPORT_INIT_LOW
	| IOPORT_INV_ENABLED);*/

	PORTE.DIRCLR = (1<<5);	//PORTE 5 Input
	PORTE.PIN5CTRL = PORT_OPC_WIREDANDPULL_gc;
	PORTF.DIRCLR = (1<<1);	//PORTF 1 Input
	PORTF.PIN1CTRL = PORT_OPC_WIREDANDPULL_gc;
		
/*	ioport_configure_pin(GPIO_PUSH_BUTTON_0, IOPORT_DIR_INPUT
	| IOPORT_LEVEL | IOPORT_PULL_UP);
	ioport_configure_pin(GPIO_PUSH_BUTTON_1, IOPORT_DIR_INPUT
	| IOPORT_LEVEL | IOPORT_PULL_UP);
	
	ioport_configure_pin(GPIO_PUSH_BUTTON_2, IOPORT_DIR_INPUT
	| IOPORT_LEVEL | IOPORT_PULL_UP);	*/
}
